import axios from '@/utils/request';

//获取所有用户
export function getSysUserList(current: number, size: number) {
    return axios({
        url: `/user/sysUser/getSysUserList/${current}/${size}`,
        method: "get"
    })
}

//新增用户
export function addSysUser(sysUser: object) {
    return axios({
        url: "/user/sysUser/addSysUser",
        method: "post",
        data: sysUser
    })
}

//修改用户
export function updateSysUser(sysUser: object) {
    return axios({
        url: "/user/sysUser/updateSysUser",
        method: "put",
        data: sysUser
    })
}

//禁用用户
export function deleteSysUser(ids: []) {
    return axios({
        url: "/user/sysUser/deleteSysUser/" + ids,
        method: "put"
    })
}

//解禁用户
export function relieveSysUser(id: number) {
    return axios({
        url: "/user/sysUser/relieveSysUser/" + id,
        method: "put"
    })
}

//根据id获取用户信息
export function getSysUser(id: number) {
    return axios({
        url: "/user/sysUser/" + id,
        method: "get"
    })
}

//搜索
export function searchSysUser(searchParams: object) {
    return axios({
        url: "/user/sysUser/searchSysUser",
        method: "post",
        data: searchParams
    })
}

//导出
export function exportSysUser() {
    return axios({
        url: "/user/sysUser/exportSysUser",
        method: "get",
        responseType: 'blob',
    })
}